<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQaecmsArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('qaecms_articles', function (Blueprint $table) {
            $table->bigIncrements('id')->comment('文章id');
            $table->string('title')->comment('文章标题');
            $table->integer('type')->comment('文章分类');
            $table->longText('introduction')->comment('文章简介');
            $table->longText('seokey')->comment('文章seo关键字用逗号隔开');
            $table->longText('thumbnail')->comment('文章缩略图');
            $table->longText('content')->comment('文章内容');
            $table->string('editor')->comment('文章作者名称');
            $table->tinyInteger('status')->comment('文章状态 1=已发布 2=草稿')->default(2);
            $table->tinyInteger('vip')->comment('浏览所需等级 0普通会员 1VIP用户')->default(0);
            $table->integer('integral')->comment('浏览所需积分')->default(0);
            $table->bigInteger('visitors')->comment('浏览人数')->default(0);
            $table->dateTime('deleted_at')->comment('软删除时间')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('qaecms_articles');
    }
}
